package servlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

import static hbase.add.add;
import static hbase.update.update;



@WebServlet(value = "/add")
public class addservlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String st1=req.getParameter("studentID");
        String e1=req.getParameter("a");
        String e2=req.getParameter("change");
        add("student","info",st1,e1,e2);

        resp.setContentType("text/html;charset=utf-8");
        PrintWriter pw=resp.getWriter();
        pw.write("<h1>"+update("student","info",st1,e1,e2));

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws  IOException {
        doGet(req,resp);
    }
}